<title>查看商品信息</title>
<style>
    .main{
        width:21%;
        height:650px;
        background: linear-gradient(to bottom,#C471ED,#c471ed,#f64f59);
        margin:30px auto;
        line-height:48px;      
    }
    .main-content{
        padding-left:40px;
    }

    .main-content button{
        width:40%;
        height:25px;
        margin-top:20px;
        float:right;
    }
    .main:hover{
        box-shadow: 3px 3px 10px #00838f;
    }
    .main h1{
        text-align:center;

    }
    .main img {
        margin-left:40px;
    }
    /*移动端代码 */
    @media screen and (max-width:500px){
            .main{
            width:85%;
            height:700px;
            border: 2px solid orange;
            margin:60px auto;
            line-height:50px;
            padding-left:30px;
            }
        }
    </style>
<?php
header("content-type:text/html; charset=utf-8");
$ck=$_GET['iid'];



$serverLink=@mysql_connect("localhost","root","root") or die("连接服务器失败！程序中断");
mysql_query("set names 'utf-8'");
$dbLink= @mysql_select_db("supermarket") or die("打开supermarket数据库失败！程序中断");
$looksql="select * from product where Id='$ck'";
$outselect=mysql_query($looksql);
$db=mysql_fetch_array($outselect);
echo "<div class=main>";
echo "<h1>商品详情</h1>";
echo "<div class=main-content>";
echo "商品名称：".$db['productname']."<br/>";
echo "商品类型：".$db['producttype']."<br/>";
echo "商品价格：".$db['productprice']."<br/>";
echo "商品剩余数量：".$db['productcount']."<br/>";
echo "入超市日期：".$db['inputdate']."<br/>";
echo "商家名称：".$db['inputname']."<br/>";
$a=$db['picturesrc'];
echo "商品图片："."<br/>";
echo "<img src='$a' width=200px height=200px />"." ";
echo "<a href=index.php><button>返回首页</button></a>";
echo "</div>";
echo "</div>";
mysql_close($serverLink);
?>

